import org.junit.Assert;
import org.junit.Test;

import java.util.List;
import java.util.regex.Matcher;

import static org.hamcrest.MatcherAssert.assertThat;


public class NGuessNumberTest {

    @Test
    public void main() {

    }

    @Test
    public void generateAnswer() {
        NGuessNumber number = new NGuessNumber();
        List<Integer> ls = number.generateAnswer();

        //断言判断是否有四个值
        Assert.assertEquals(ls.size(),4);

        //断言四个值是否重复
        for (int i = 0; i < ls.size(); i++) {
            for (int j = i+1; j < ls.size(); j++) {
                Assert.assertNotEquals(ls.get(i),ls.get(j));
            }
        }

        //判断是否都是0-9
        for (Integer l : ls) {
            if (l >= 0 && l <= 9) {
                System.out.println("数据正常");
            } else {
                System.out.println("数据出错");
            }
        }
    }

    @Test
    public void getPlayerInput() {
        NGuessNumber number = new NGuessNumber();
        List<Integer> ls = number.getPlayerInput();

        //断言判断是否有四个值
        Assert.assertEquals(ls.size(),4);
    }

    @Test
    public void compareGuessAnswer() {
    }


    @Test
    public void isWin() {
    }
}